
#include "sub1.h"

#include <stdio.h>
#include <stdlib.h>

struct sub1_s {
    base_t base_;
    int int_value_;
};

static void sub1_free(base_t * ptr){
    printf("sub1_free\n");
    sub1_t * this = (sub1_t *)ptr;
    free(this);
}
static int sub1_encrypted(base_t * ptr, char * src, char * dest){
    sub1_t * this = (sub1_t *)ptr;
    return this->int_value_;
}
static int sub1_get_value(base_t * ptr){
    sub1_t * this = (sub1_t*)ptr;
    return this->int_value_;
}

static void sub1_set_value(base_t * ptr, int value){
    sub1_t * this = (sub1_t*)ptr;
    this->int_value_ = value;
}


sub1_t * sub1_create(int int_value){
    sub1_t * ret = (sub1_t*)malloc(sizeof(sub1_t));
    base_interface_init((base_t*)ret, sub1_free, sub1_encrypted, sub1_get_value, sub1_set_value, int_value);
    ret->int_value_ = int_value;
    return ret;
}
